<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <title>排行榜-教育论坛</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="/css/bootstrap.min.css">
  <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
  <script src="/js/jquery-3.6.0.min.js"></script>
  <script src="/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <a class="navbar-brand" href="/">教育论坛</a>
      <a class="navbar-brand" href="/rank/1"><span class="glyphicon glyphicon-signal" aria-hidden="true"></span>&nbsp;排行榜</a>
      <ul class="nav navbar-nav navbar-right">
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">选项<span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="/rank/2">发帖数排行</a></li>
            <li><a href="/rank/3">回帖数排行</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="/rank/1">总排行</a></li>
          </ul>
        </li>
      </ul>
    </div>
    </div>
</nav>
<div class="row">
  <div class="col-md-3"></div>
  <div class="col-md-6">
    <div class="panel panel-default">
      <div class="panel-heading">排行榜</div>
      <div class="panel-body">
        <p>排行榜默认是通过近期用户的发帖数和回帖数进行排行的</p>
      </div>
      <table class="table table-striped">
        <thead>
        <tr>
          <th>排名</th>
          <th>用户名</th>
          <th>发帖数</th>
          <th>回帖数</th>
          <th>活跃度</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="user : ${users}">
          <th th:text="${user.rank}"></th>
          <th th:text="${user.name}"></th>
          <th th:text="${user.questionCount}"></th>
          <th th:text="${user.commentCount}"></th>
          <th th:text="${user.active}"></th>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
</body>
</html>